<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>删除用户</title>
<script type="text/javascript">
/* 删除用户 */
	function deleteProduct(id){
		var id=document.getElementById("id").value;
		var ajax;
		if(window.XMLHttpRequest){
			ajax=new XMLHttpRequest();
		}
	    ajax.onreadystatechange=function(){ /* 存储函数（或函数名），每当 readyState 属性改变时，就会调用该函数。 */
			if(ajax.readyState==4){
				if(ajax.status==200){
					var result=ajax.responseText;
					eval("var p="+result);
					alert(result+"删除成功!"); 
					var table=document.getElementById("table");
				}
			}
		}
		ajax.open("get","deleteProduct?id="+id);
		ajax.send(null);
	}

</script>
</head>
<body>
<h1>删除用户</h1>

<table>
商品ID：
<input type="text" name="username" id="username" />
<input type="submit" name="button" value="删除" onclick="deleteProduct()" />
</table>
</body>
</html>